package me.spring.cloud.common.components.dlog.provider;

import me.spring.cloud.common.components.dlog.LogProvider;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.logging.LogLevel;
import org.springframework.boot.logging.LoggingSystem;

/**
 * SpringBootLog实现
 *
 * @author
 * @date 2018/8/23
 */
public class SpringBootProvider implements LogProvider {

  @Autowired
  private LoggingSystem loggingSystem;

  @Override
  public Map fetchAllLoggers() {
    return null;
  }

  @Override
  public void refresh(String name, String logLevel) {
    LogLevel level = LogLevel.valueOf(logLevel);
    loggingSystem.setLogLevel(name, level);
  }
}